﻿
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Clarendon.AzureBilling.Library
{
    /// <summary>
    /// Contains the necessary properties to support a hosted service and map onto the XML of the same
    /// </summary>
    [DataContract]
    public class HostedService
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public HostedService()
        {
        }

        /// <summary>
        /// Copy constructor for HostedService
        /// </summary>
        public HostedService(HostedService service)
        {
            Name = service.Name;
            AffinityGroup = service.AffinityGroup;
            Url = service.Url;
            Description = service.Description;
            Location = service.Location;
        }

        /// <summary>
        /// Overloaded constructor used to determine the name of the service
        /// </summary>
        public HostedService(string name)
        {
            Name = name;
        }

        /// <summary>
        /// Property to hold the name of the service
        /// </summary>
        [DataMember]
        public string Name { get; set; }
        /// <summary>
        /// This is the URL of the service - either staging or production
        /// </summary>
        [DataMember]
        public string Url { get; set; }
        /// <summary>
        /// This is the description of the service
        /// </summary>
        [DataMember]
        public string Description { get; set; }
        /// <summary>
        /// This is the location of the service West Europe, North Europe, US etc.
        /// </summary>
        public string Location { get; set; }
        /// <summary>
        /// This is the affinity group 
        /// </summary>
        [DataMember]
        public string AffinityGroup { get; set; }
        /// <summary>
        /// Gets and sets a list of the deployments associated with this hosted service
        /// </summary>
        [DataMember]
        public List<Deployment> Deployments { get; set; }
    }
}
